from django.contrib import admin
from .models import BlogArticles


class BlogArticlesAdmin(admin.ModelAdmin):
    list_display = ("title", "author", "publish")  # 详细信息
    list_filter = ("publish", "author")  # 过滤器
    search_fields = ("title", "body")  # 搜索
    raw_id_fields = ("author",)  # 以输入框的形式展现
    date_hierarchy = "publish"  # 时间筛选
    ordering = ['publish', 'author']  # 排序


admin.site.register(BlogArticles, BlogArticlesAdmin)

